﻿
@{
	Layout = null; 
	ViewBag.Title = "拉美数据";
}
 
<script src="~/Scripts/jquery-1.10.2.js"></script>
<link href="~/Content/base.css" rel="stylesheet" />
<link href="~/Content/bootstrap.min.css" rel="stylesheet" /> 
<link href="~/Content/component.css" rel="stylesheet" />
<link href="~/Content/common.css" rel="stylesheet" />
<link href="~/Content/style.css?id=1" rel="stylesheet" /> 
<script src="~/Scripts/bootstrap.min.js"></script>
<script src="~/Scripts/bootstrap-datetimepicker.js"></script>
<script src="~/Scripts/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="~/Scripts/component.js"></script>
<script src="~/Scripts/vue/vue.min.js"></script>
@*<script src="~/Scripts/vue/vue-resource.js"></script>*@
<script src="https://cdn.jsdelivr.net/vue.resource/1.3.1/vue-resource.min.js"></script>
<script src="~/Scripts/JPlaceholder.js"></script>
<script src="~/Scripts/bootbox.min.js"></script>

<div id="wrapper" class="container clearfix">
	<div id="header">
		<hrader-component :text="text"></hrader-component>
	</div>
	<div class="clearfix box">
		<div class="fl">
			<div id="nav">
				<nav-component :a_text1="a_text1" :a_text2="a_text2"></nav-component>
			</div>
		</div>
		<div class="fl pl-10" id="center">
			<div class="boxTop">
				<div class="search clearfix">
					<a href="javascript:;" class="btn btn-default fr" id="keyWordSearch">
						<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
					</a>
					desc降序，asc升序，Price=商品价格，PScore=评分，SaleCount=销售总数，PComment=评论条数，PastTimesCount=过去4个月销售
					<input id="SearchWord" type="text" class="form-control fr" placeholder="SaleCount desc" />
				 	<input id="isZy" type="text" class="form-control fr" placeholder="是否自营" />-1=全部 0=非自营 1=自营
				</div>
			</div>
			<div class="boxBottom yuanmm_setOpe">
				<table id="GetListScenic" class="table table-hover table-bordered">
					<tr>
						<td>序号</td>
						<th>是否自营</th>
						<th>最新销售</th>
						<th>过去4个月销售</th> 
						<th>商品名称</th>
						<th>图片URL1</th>
						<th>图片URL2</th>
						<th>评分</th>
						<th>评论条数</th> 
						<th>原价</th> 
						<th>售卖价</th> 
						<th>优惠比例</th> 
						<th>类别1</th>   
						<th>二级类别</th> 
						<th>三级类别</th> 
						<th>4级类别</th> 
					</tr>
					<tr v-for="(item,index) in List" :data-tr-index="index">
						<td v-text="index+1"></td>
						<td>{{item.isZy=='1'?"自营":"非自营"}}</td>
						<td v-text="item.SaleCount"></td>
						<td v-text="item.PastTimesCount"></td>
						<td><a target="_blank" :href="item.PUrl"> {{item.PName}}</a> </td>
						<td><a target="_blank" :href="item.PicUrl1"> <img :src="item.PicUrl1"  width="300" height="300"/></a></td>
						<td><a target="_blank" :href="item.PicUrl2"><img :src="item.PicUrl2" width="300" height="300"/></a></td>
						<td v-text="item.PScore"></td> 
						<td v-text="item.PComment"></td>
						<td v-text="item.OriginalPrice"></td>
						<td v-text="item.Price"></td>
						<td v-text="item.PreferentialProportion"></td> 
						<td v-text="item.CategoryClassID"></td>
						<td v-text="item.Class1"></td>
						<td v-text="item.Class2"></td>
						<td v-text="item.Class3"></td>
					
					</tr>
				</table>
				<div id="Pagination">
					<pagination-component :Count="Count" :current-index="currentIndex" :page-sizes="pageSizes" :jump-page="jumpPage" :page-size="pageSize"></pagination-component>
				</div>
			</div>
		</div>
	</div>
</div>
 
<div class="opeTips" id="opeTips"></div>

<script>


	var trIndex;
	Vue.http.options.emulateJSON = true;
	var SearchWord = GetQueryStringH("SearchWord") == null ? "" : GetQueryStringH("SearchWord");
	var isZy = GetQueryStringH("isZy") == null ? "-1" : GetQueryStringH("isZy");
	var CurrentIndex = GetQueryStringH("CurrentIndex") == null ? 1 : GetQueryStringH("CurrentIndex");
	var PageSize = GetQueryStringH("PageSize") == null ? 10 : GetQueryStringH("PageSize");
	$("#SearchWord").val(SearchWord);
	$("#isZy").val(isZy);
	var obj = {
		"SearchWord": SearchWord,
		"isZy": isZy,
		"CurrentIndex": CurrentIndex,
		"PageSize": PageSize
	}
	var dataList = new Vue({
		el: "#GetListScenic",
		data: {
			List: []
		},
		mounted: function () {	
			this.getList();
		},
		methods: {
			getList() {
				this.$http.post("/LameiDate/GetAgentEmpowerList", obj)
					.then(function (res) {
						console.log(res);
						var result = res.body;
						dataList.List = result.Data.Items;
						Pagination.Count = result.Data.PageCount;
						CurrentIndex = GetQueryStringH("CurrentIndex") == null ? 1 : GetQueryStringH("CurrentIndex");
						Pagination.currentIndex = setCurrentIndex(result.Data.PageCount, 1, CurrentIndex);

					}, function (err) {
						console.log(err)
					})
			}
		}
	})
	//分页及检索
	Flip($(document), "#Pagination li", "click", obj, "CurrentIndex");
	Flip($(document), '#page', "change", obj, "PageSize");
	Flip($(document), '#jumpPage', "change", obj, "CurrentIndex");
	Flip($(document), '#isZy', "change", obj, "isZy", $("#isZy"));
	Flip($(document), '#keyWordSearch', "click", obj, "SearchWord", $("#SearchWord"));
	window.onhashchange = function () {
		hashchange(obj, Pagination.Count, function () {
			dataList.getList();
		});
	}
</script>

<script src="/Scripts/htmlcomponent.js?id=1"></script>